package com.rtp.transformer.fin.client;
import com.google.gwt.dom.client.Document;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class Report extends Sink {

	public static SinkInfo init() {
		return new SinkInfo(
				"Report",
				"<h2>Gao Wen can get Report by this interface</h2>"
						+ "<p>This is the Demo.</p>  "

						+ "<p>The data will be generate report from FIN database.</p> ") {

			public Sink createInstance() {
				return new Report();
			}
		};
	}
	public Report() {

		final VerticalPanel vp = new VerticalPanel();
		initWidget(vp);

		final HorizontalPanel hp = new HorizontalPanel();
		vp.add(hp);

		final RadioButton lastMonthRadioButton = new RadioButton("new-group");
		hp.add(lastMonthRadioButton);
		lastMonthRadioButton.setChecked(true);
		lastMonthRadioButton.setText("last month");

		final RadioButton currentMonthRadioButton = new RadioButton("new-group");
		hp.add(currentMonthRadioButton);
		currentMonthRadioButton.setText("current month");

		final HorizontalPanel horizontalPanel_1 = new HorizontalPanel();
		vp.add(horizontalPanel_1);

		final Button generateReportButton = new Button();
		horizontalPanel_1.add(generateReportButton);
		generateReportButton.setText("Generate Report");
		generateReportButton.addClickListener(new ClickListener(){

			public void onClick(Widget sender) {
				// TODO Auto-generated method stub
				Window.open("Download", "download", "");
			}
			
		});
	}
}
